package com.mentaleye.dal.dao.mybatis;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.mentaleye.dal.dao.UserLoginDao;
import com.mentaleye.dal.model.UserLogin;
import com.mentaleye.dal.model.UserLoginExample;
import com.mentaleye.dal.service.UserLoginMapper;

@Repository
public class UserLoginDaoImpl implements UserLoginDao {

	@Autowired private UserLoginMapper dataMapper;
	
	@Override
	public boolean insertRecord(UserLogin data) {
        boolean isSuccess=false;
        if(this.dataMapper.insert(data)>0){
        	isSuccess=true;
        }
		return isSuccess;
	}
	
	@Override
	public boolean insertByList(List<UserLogin> dataList) {
		boolean isSuccess=false;
        if(this.dataMapper.insertByList(dataList)>0){
        	isSuccess=true;
        }
		return isSuccess;
	}

	@Override
	public boolean updateRecord(UserLogin data) {
		boolean isSuccess=false;
        if(this.dataMapper.updateByPrimaryKey(data)>0){
        	isSuccess=true;
        }
		return isSuccess;
	}
	
	@Override
	public boolean updateRecordBySelective(UserLogin data) {
		boolean isSuccess=false;
        if(this.dataMapper.updateByPrimaryKeySelective(data)>0){
        	isSuccess=true;
        }
		return isSuccess;
	}

	@Override
	public List<UserLogin> getListByExample(UserLoginExample example) {
		return this.dataMapper.selectByExample(example);
	}

	@Override
	public boolean deleteByExample(UserLoginExample example) {
		boolean isSuccess=false;
        if(this.dataMapper.deleteByExample(example)>0){
        	isSuccess=true;
        }
		return isSuccess;
	}

	@Override
	public List<Map<String, Object>> getLoginByMap(Map<String, Object> map) {
		return this.dataMapper.getLoginByMap(map);
	}
}
